package com.mycompany.app.hr.eleave.service.leavepolicy.impl;

import com.mycompany.app.hr.eleave.exception.LeaveValidationException;
import com.mycompany.app.hr.eleave.model.LeaveApplication;
import com.mycompany.app.hr.eleave.service.leavepolicy.ILeavePolicyCheck;
import com.mycompany.app.hr.pa.model.Employee;

/**
 * 丧假
 * <=3 days
 * @author Shawn.guo
 *
 */
public class CompassionateLeaveCheck implements ILeavePolicyCheck{

    public void check(Employee employee, LeaveApplication app)
            throws LeaveValidationException {
        
        if(app.calculateCalendarDays()>3)
            throw new LeaveValidationException(
                    LeaveValidationException.COMPASSIONATE);
        
    }

}
